﻿using System;
using System.Collections;
using System.Collections.Generic;
using Tedu.ARPGDemo.Character;
using UnityEngine;

namespace AI.FSM
{
    /// <summary>
    /// 攻击
    /// </summary>
    public class AttackingState : FSMState
    {
        private float attackTime;
        protected override void Init()
        {
            StateID = FSMStateID.Attacking;
        }
        public override void Action(FSMBase fsm)
        {
            base.Action(fsm);
            //如果到了攻击时间
            if (attackTime <= Time.time)
            {
                //print("放技能");
                fsm.skillSystem.UseRandomSkill();
                //设置下次攻击时间
                attackTime = Time.time + fsm.chStatus.attackInterval;
            }
            fsm.transform.LookAt(fsm.transform);
            
        }
    }
}

